CREATE TABLE e107_church_tbl (
 	id int(11) NOT NULL auto_increment,
	type varchar(20) NOT NULL default '',
	PRIMARY KEY (id),
	UNIQUE KEY ref (id,type)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 

CREATE TABLE e107_rooster_tbl (
	id int(11) NOT NULL auto_increment,
	church_id int(11) NOT NULL,
	job_id int(11) NOT NULL,
	user_id int(11) NOT NULL,
	job_date date NOT NULL,
	PRIMARY_KEY (id),
	UNIQUE KEY ref (id, church_id, user_id, job_date)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE e107_church_user_tbl (
	id int(11) NOT NULL auto_increment,
	name varchar(20) NOT NULL default '',
	PRIMARY_KEY (id),
	UNIQUE KEY ref (id, name)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

CREATE TABLE e107_activity_tbl (
	id int(11) NOT NULL auto_increment,
	name varchar(20) NOT NULL default '',
	PRIMARY KEY(id),
	UNIQUE KEY (id, name)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
	
CREATE TABLE e107_job_tbl (
	id int(11) NOT NULL auto_increment,
	activity_id int(11) NOT NULL,
	name varchar(20) NOT NULL default '',
	PRIMARY_KEY (id),
	UNIQUE_KEY (id, activity_id, name)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
